SELECT USER_NAME(ss.principal_id) AS 'user', st.name AS table_name
	FROM sys.tables st
		JOIN sys.schemas ss ON (ss.schema_id = st.schema_id)
WHERE (st.object_id NOT IN (SELECT major_id 
							FROM sys.extended_properties)) AND (USER_NAME(ss.principal_id) = 'dbo')

SELECT USER_NAME(ss.principal_id) AS 'user', so.name AS table_name, sc.name AS column_name, sc.is_nullable AS 'null',
	   st.name AS 'type_name', sc.max_length AS 'size' 
	FROM sys.objects so
		JOIN sys.columns sc ON (sc.object_id = so.object_id)
		JOIN sys.types st ON (sc.user_type_id = st.user_type_id)
		JOIN sys.schemas ss ON (ss.schema_id = so.schema_id)
	WHERE (so.type = 'U') AND (USER_NAME(ss.principal_id) ='dbo') AND (so.object_id NOT IN (SELECT major_id 
																								FROM sys.extended_properties))

SELECT USER_NAME(ss.principal_id) AS 'user', so1.name AS key_name, so2.name AS table_name, so1.type
	FROM sys.objects so1, sys.objects so2
		JOIN sys.schemas ss ON (ss.schema_id = so2.schema_id)
	WHERE (so1.parent_object_id = so2.object_id) AND ((so1.type = 'F') OR (so1.type = 'PK')) AND (USER_NAME(ss.principal_id) ='dbo')
	AND (so1.object_id NOT IN (SELECT major_id 
							FROM sys.extended_properties))
	ORDER BY 4

SELECT USER_NAME(ss.principal_id) AS 'user', sfk.name AS kname, so1.name AS fname, sc1.name AS fcolumn, 
		so2.name AS kname, sc2.name AS kcolumn
	FROM sys.foreign_keys sfk
		JOIN sys.objects so1 ON (sfk.parent_object_id = so1.object_id)
		JOIN sys.objects so2 ON (sfk.referenced_object_id = so2.object_id)
		JOIN sys.foreign_key_columns sfkc ON (sfkc.constraint_object_id = sfk.object_id)
		JOIN sys.columns sc1 ON (sfkc.parent_object_id = sc1.object_id AND sfkc.parent_column_id = sc1.column_id)
		JOIN sys.columns sc2 ON (sfkc.referenced_object_id = sc2.object_id AND sfkc.referenced_column_id = sc2.column_id)
		JOIN sys.schemas ss ON (ss.schema_id = so1.schema_id)
	WHERE (USER_NAME(ss.principal_id) ='dbo')
	ORDER BY 3


SELECT USER_NAME(ss.principal_id) AS 'user', TABLE_NAME AS view_name, VIEW_DEFINITION AS def
	FROM INFORMATION_SCHEMA.VIEWS
		JOIN sys.schemas ss ON (SCHEMA_ID(TABLE_SCHEMA) = ss.schema_id)
	WHERE (USER_NAME(ss.principal_id) ='dbo')

SELECT USER_NAME(ss.principal_id) AS 'user', st.name AS table_name
	FROM sys.triggers
		JOIN sys.tables st ON (st.object_id = parent_id)
		JOIN sys.schemas ss ON (ss.schema_id = st.schema_id)
	WHERE (USER_NAME(ss.principal_id) ='dbo')

SELECT DISTINCT name, SUM(size * 8 )AS KB 
	FROM  sys.database_files sdf
	GROUP BY name

SELECT *
	FROM sys.dm_exec_requests sder, sys.dm_tran_locks sdtl
	WHERE (sder.session_id = sdtl.request_session_id)